<template>
  <div>
      <!-- 面包屑 -->
      <el-baner></el-baner>
      <!-- 添加按钮 -->
      <el-button type="primary" @click="add">添加</el-button>
      <!-- 表格 -->
      <v-list @edit="edit"></v-list>
      <!-- 弹框 -->
      <v-dialog ref="dai" @cancel="cancel" :addinfo="addinfo"></v-dialog>
  </div>
</template>
<script setup lang="ts">
import {reactive,ref} from 'vue'
import elBaner from '@/common/elbread.vue'
import vDialog from './dialog.vue'
import vList from './list.vue'
let addinfo = reactive({
  flag:false,
  isShow:true
})

let add = ()=>{
  addinfo.flag = true
  addinfo.isShow = true
}

let cancel = (e:any):void=>{
  addinfo.flag = e
}
//绑定ref子组件获取实例
let dai = ref()
let edit = (id:any)=>{
  addinfo.flag = true
  addinfo.isShow = false
  //调用子组件的实例将id传过去
  dai.value.lookup(id)
}
</script>

<style scoped>

</style>